#include "tracexportwizard.h"
#include "tracvalidationpage.h"
#include "tracexportprojectselectionpage.h"
#include "tracexportsettingspage.h"
#include "tracsettings.h"
#include "vcsbase/checkoutjobs.h"

#include <QtGui/QIcon>
#include <QSharedPointer>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/project.h>

namespace Trac {
namespace Internal {

TracExportWizard::TracExportWizard(QObject *parent)
    : VCSBase::BaseCheckoutWizard(parent)
{
    setId("TracRepository");
}

TracExportWizard::~TracExportWizard()
{
    TracSettings::instance()->~TracSettings();
}

QIcon TracExportWizard::icon() const
{
    return QIcon();
}

QString TracExportWizard::description() const
{
    return tr("Export a trac project from Qt Creator.");
}

QString TracExportWizard::displayName() const
{
    return tr("Trac Project Export");
}

QList<QWizardPage *> TracExportWizard::createParameterPages(const QString &path)
{

    TracValidationPage *page1 = new TracValidationPage();
    TracExportProjectSelectionPage *page2 = new TracExportProjectSelectionPage(page1);
    TracExportSettingsPage *page3 = new TracExportSettingsPage(page2);
    TracSettings::instance()->setWorkingPath(path);

    QList<QWizardPage *> pages;
    return pages << page1 << page2 << page3;
}

QSharedPointer<VCSBase::AbstractCheckoutJob> TracExportWizard::createJob(
        const QList<QWizardPage *> &parameterPages, QString *checkoutPath)
{
    // TODO: Implement
    return createCheckoutJob(checkoutPath);
}


QSharedPointer<VCSBase::AbstractCheckoutJob> TracExportWizard::createCheckoutJob(QString *checkoutPath) const
{
    // TODO: Implement
}

} // namespace Internal
} // namespace Trac
